/**
 * Created by Ivan Babanin (22.07.2007 15:12:18)
 * This part of code is strictly confidential.
 * © Magnificent Software Inc.
 */
package com.silverhaze.diamond.client.ui.dialogs;

import com.silverhaze.diamond.client.ui.UIStringConstants;

import javax.swing.*;
import java.awt.*;

public class Dialogs {
    public static void showErrorDialog(Component parent, String message) {
        JOptionPane.showMessageDialog(parent, message, "Error", JOptionPane.ERROR_MESSAGE);
    }

    public static void showErrorDialog(Component parent, Exception e) {
        JOptionPane.showMessageDialog(parent, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
    }

    public static void showMessageDlg(Component parent, String message, String title) {
        JOptionPane.showMessageDialog(parent, message, title, JOptionPane.PLAIN_MESSAGE);
    }

    public static int exitDialog(Component parent) {
        return JOptionPane.showConfirmDialog(parent, UIStringConstants.ARE_YOU_SHURE_WANT_QUIT, "Shut down", JOptionPane.OK_CANCEL_OPTION);
    }
}

